﻿<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:VMDS_GUIClient_ViewModels_Management="clr-namespace:VMDS.GUIClient.ViewModels.Management" 
	  xmlns:ns="clr-namespace:VMDS.GUIClient.Helper" 
	  xmlns:Model="clr-namespace:VMDS.GUIClient.Model" 
	  xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"

      xmlns:VMDS_GUIClient_Views_Management_Storages="clr-namespace:VMDS.GUIClient.Views.Management.Storages" xmlns:Storages="clr-namespace:VMDS.GUIClient.ViewModels.Management.Storages" x:Name="page" x:Class="VMDS.GUIClient.Views.Management.StorageManagement"

      mc:Ignorable="d" 
      d:DesignHeight="417" d:DesignWidth="726"
	Title="StorageManagement">
	<Page.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/VMDS.GUIClient;component/Simple Styles.xaml"/>
				<ResourceDictionary Source="/VMDS.GUIClient;component/Views/AutoScrollListBoxDictionary.xaml"/>
				<ResourceDictionary Source="/VMDS.GUIClient;component/Views/ResourceDictionary1.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<ns:BooleanToHiddenVisibility x:Key="BooleanToHiddenVisibility"/>
			<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
			<Storyboard x:Key="OnLoaded1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="page">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.075"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</ResourceDictionary>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard x:Name="OnLoaded1_BeginStoryboard" Storyboard="{StaticResource OnLoaded1}"/>
		</EventTrigger>
	</Page.Triggers>

	<Page.DataContext>
		<Storages:StorageManagementViewModel/>
	</Page.DataContext>

    <Grid x:Name="grid">
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.375*"/>
    		<ColumnDefinition Width="0.625*"/>
    	</Grid.ColumnDefinitions>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="219.829"/>
    		<RowDefinition Height="*"/>
    	</Grid.RowDefinitions>
    	
        <Rectangle Margin="5" Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10">
        	<Rectangle.Fill>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
        			<LinearGradientBrush.RelativeTransform>
        				<TransformGroup>
        					<ScaleTransform CenterY="0.5" CenterX="0.5"/>
        					<SkewTransform CenterY="0.5" CenterX="0.5"/>
        					<RotateTransform CenterY="0.5" CenterX="0.5"/>
        					<TranslateTransform/>
        				</TransformGroup>
        			</LinearGradientBrush.RelativeTransform>
        			<GradientStop Color="#FFEFECEC"/>
        			<GradientStop Offset="0.558"/>
        			<GradientStop Color="#FFEFECEC" Offset="1"/>
        			<GradientStop Offset="0.494"/>
        		</LinearGradientBrush>
        	</Rectangle.Fill>
        </Rectangle>
        <Rectangle Margin="5,5,8,5" Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10" Grid.Row="1" Grid.ColumnSpan="2">
        	<Rectangle.Fill>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
        			<LinearGradientBrush.RelativeTransform>
        				<TransformGroup>
        					<ScaleTransform CenterY="0.5" CenterX="0.5"/>
        					<SkewTransform CenterY="0.5" CenterX="0.5"/>
        					<RotateTransform CenterY="0.5" CenterX="0.5"/>
        					<TranslateTransform/>
        				</TransformGroup>
        			</LinearGradientBrush.RelativeTransform>
        			<GradientStop Color="#FFEFECEC"/>
        			<GradientStop Offset="0.558"/>
        			<GradientStop Color="#FFEFECEC" Offset="1"/>
        			<GradientStop Offset="0.494"/>
        		</LinearGradientBrush>
        	</Rectangle.Fill>
        </Rectangle>
    	
        <ListBox Margin="18,16,24.25,45" Style="{DynamicResource ListBoxWithAutoScroll_Vertical}" ItemsSource="{Binding Storages}" Background="{x:Null}" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemTemplate="{DynamicResource MyEquityTemplate2}" BorderBrush="#FF397589" BorderThickness="1" SelectedItem="{Binding CurrentStorage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        <WebBrowser x:Name="webBrowser" Margin="18,17,22,17" Grid.Row="1" ns:WebBrowserUtility.BindableSource="{Binding CurrentStorage.Path}" Grid.ColumnSpan="2" Visibility="{Binding BrowserVisible, Converter={StaticResource BooleanToHiddenVisibility}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <Button Content="Удалить" Height="32" Margin="0,0,24.25,9" Grid.Row="0" VerticalAlignment="Bottom" Command="{Binding DelStorage, Mode=OneWay}" Style="{DynamicResource GreenButton}" Grid.Column="0" FontWeight="Bold" HorizontalAlignment="Right" Width="88"/>
        <Button Content="Добавить..." Height="32" Margin="18,0,0,9" Grid.Row="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="86" Command="{Binding AddStorage, Mode=OneWay}" Style="{DynamicResource GreenButton}" Grid.Column="0" FontWeight="Bold"/>
        <Rectangle x:Name="rectangle" Grid.Column="1" HorizontalAlignment="Right" Height="17.171" Margin="0,0,78,27.829" VerticalAlignment="Bottom" Width="32" Visibility="{Binding AddVisible, Converter={StaticResource BooleanToHiddenVisibility}, Mode=TwoWay}"/>
        <StackPanel Grid.Column="1" HorizontalAlignment="Left" Margin="127.75,96,0,99.829" Width="32" Orientation="Horizontal">
        	<TextBlock/>
        </StackPanel>
        <Rectangle Margin="5,5,8,5" Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10" Grid.Column="1">
        	<Rectangle.Fill>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
        			<LinearGradientBrush.RelativeTransform>
        				<TransformGroup>
        					<ScaleTransform CenterY="0.5" CenterX="0.5"/>
        					<SkewTransform CenterY="0.5" CenterX="0.5"/>
        					<RotateTransform CenterY="0.5" CenterX="0.5"/>
        					<TranslateTransform/>
        				</TransformGroup>
        			</LinearGradientBrush.RelativeTransform>
        			<GradientStop Color="#FFEFECEC"/>
        			<GradientStop Offset="0.558"/>
        			<GradientStop Color="#FFEFECEC" Offset="1"/>
        			<GradientStop Offset="0.494"/>
        		</LinearGradientBrush>
        	</Rectangle.Fill>
        </Rectangle>
        <TextBlock Grid.Column="1" HorizontalAlignment="Right" Height="0" Margin="0,0,150,27.829" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Bottom" Width="0"/>
        <Grid Grid.Column="1" Margin="15.75,10,22,67.829" IsEnabled="{Binding EditVisible}">
        	<TextBox Margin="104,8,104,0" TextWrapping="Wrap" Text="{Binding StName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="30" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" FontStyle="Italic" TextAlignment="Center"/>
        	<TextBox x:Name="PathBox" Margin="104,52,104,64" TextWrapping="Wrap" Text="{Binding StPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="30" FontSize="13.333" FontStyle="Italic"/>
        	<TextBlock HorizontalAlignment="Left" Margin="12,8,0,0" TextWrapping="Wrap" Text="Название" Width="88" FontSize="16" FontWeight="Bold" Height="24" VerticalAlignment="Top"/>
        	<TextBlock HorizontalAlignment="Left" Margin="12,52,0,54.829" TextWrapping="Wrap" Text="Путь" Width="88" FontSize="16" FontWeight="Bold"/>
        	<TextBlock Height="32" Margin="16,0,112,18.829" TextWrapping="Wrap" Text="{Binding ValidationMessage}" VerticalAlignment="Bottom" Foreground="#FFDE1818" FontWeight="Bold" Visibility="{Binding EditVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        </Grid>
        <Button Grid.Column="1" Margin="0,42,38,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="72" Command="{Binding ShowEdit, Mode=OneWay}" Height="30" Background="{x:Null}" OpacityMask="#FFFDFDFD" Style="{DynamicResource GreenButton}" Grid.Row="0" d:LayoutOverrides="GridBox" Content="Изменить"/>
        <Button x:Name="BrowseButton" Content="Обзор..." Grid.Column="1" HorizontalAlignment="Right" Height="Auto" Margin="0,92,126,99.829" Width="64" Style="{DynamicResource GreenButton}" Grid.Row="0" Click="BrowseButton_Click" Visibility="{Binding EditVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <Button x:Name="button" Grid.Column="1" HorizontalAlignment="Right" Height="32" Margin="0,0,22,9" Grid.Row="0" Style="{DynamicResource GreenButton}" VerticalAlignment="Bottom" Width="88" Content="Сохранить" Command="{Binding Edit, Mode=OneWay}" Visibility="{Binding EditVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <VMDS_GUIClient_Views_Management_Storages:AddStorageDialog d:LayoutOverrides="Width, Height" Grid.RowSpan="2" Grid.ColumnSpan="2" Visibility="{Binding Visibility, ElementName=rectangle, Mode=TwoWay}"/>
        <Rectangle x:Name="rectangle1" Fill="#87000000" Margin="0" Stroke="Black" Grid.RowSpan="2" Grid.ColumnSpan="2" Visibility="{Binding LoadVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Загрузка..." VerticalAlignment="Center" Grid.RowSpan="2" Grid.ColumnSpan="2" Visibility="{Binding Visibility, ElementName=rectangle1}" FontSize="29.333" Foreground="#FFA52121" FontWeight="Bold"/>

    </Grid>
</Page>
